package com.emagic.manage.modules.room.adapter;

import android.content.Context;

import org.webrtc.IceCandidate;
import org.webrtc.MediaStream;
import org.webrtc.PeerConnection;
import org.webrtc.SessionDescription;
import org.webrtc.VideoRenderer;

import java.util.LinkedList;

import fi.vtt.nubomedia.webrtcpeerandroid.NBMMediaConfiguration;
import fi.vtt.nubomedia.webrtcpeerandroid.NBMWebRTCPeer;

interface IPeerConnectionAdapter {
    void init(NBMMediaConfiguration config, Context context, VideoRenderer.Callbacks localRenderer, NBMWebRTCPeer.Observer observer);
    void setActiveMasterStream(MediaStream stream);
    void registerMasterRenderer(VideoRenderer.Callbacks masterRenderer);
    boolean isInitialized();
    void generateOffer(String connectionId, boolean includeLocalMedia);
    LinkedList<PeerConnection.IceServer> getIceServers();
    void setIceServers(LinkedList<PeerConnection.IceServer> iceServers);
    void addIceServer(String serverURI);
    void processOffer(SessionDescription remoteOffer, String connectionId);
    void processAnswer(SessionDescription remoteAnswer, String connectionId);
    void addRemoteIceCandidate(IceCandidate remoteIceCandidate, String connectionId);
    void closeConnection(String connectionId);
    void close();
    boolean startLocalMedia();
    void stopLocalMedia();
    void attachRendererToRemoteStream(VideoRenderer.Callbacks remoteRender, MediaStream remoteStream);
    void selectCameraPosition(NBMMediaConfiguration.NBMCameraPosition position);
    void switchCameraPosition();
    boolean hasCameraPosition(NBMMediaConfiguration.NBMCameraPosition position);
    boolean videoEnabled();
    void enableVideo(boolean enable);
    boolean audioEnabled();
    void enableAudio(boolean enable);
    boolean videoAuthorized();
    boolean audioAuthorized();
}
